/* 全局样式文件 */

/* 主题颜色 */
$primary-color: #FF69B4; /* 粉红色主题 */
$primary-light: rgba(255, 105, 180, 0.1);
$primary-dark: #E94C9F;
$secondary-color: #409EFF;
$success-color: #67C23A;
$warning-color: #E6A23C;
$danger-color: #F56C6C;
$info-color: #909399;

/* 文本颜色 */
$text-color-primary: #333333;
$text-color-regular: #666666;
$text-color-secondary: #999999;
$text-color-placeholder: #C0C4CC;

/* 背景颜色 */
$background-color: #F8F8F8;
$background-color-light: #FFFFFF;
$background-color-dark: #F5F5F5;

/* 边框颜色 */
$border-color: #EBEEF5;
$border-color-light: #F2F6FC;
$border-color-dark: #DCDFE6;

/* 字体大小 */
$font-size-extra-large: 36rpx;
$font-size-large: 32rpx;
$font-size-medium: 28rpx;
$font-size-base: 26rpx;
$font-size-small: 24rpx;
$font-size-extra-small: 22rpx;

/* 圆角 */
$border-radius-large: 16rpx;
$border-radius-medium: 12rpx;
$border-radius-small: 8rpx;
$border-radius-circle: 50%;

/* 间距 */
$spacing-extra-large: 40rpx;
$spacing-large: 30rpx;
$spacing-medium: 20rpx;
$spacing-small: 15rpx;
$spacing-extra-small: 10rpx;

/* 阴影 */
$box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
$box-shadow-light: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
$box-shadow-dark: 0 4rpx 16rpx rgba(0, 0, 0, 0.15);

/* 过渡动画 */
$transition-duration: 0.3s;
$transition-timing-function: ease;

/* 全局样式 */
page {
  background-color: $background-color;
  color: $text-color-primary;
  font-size: $font-size-base;
  box-sizing: border-box;
}

/* 通用容器 */
.container {
  padding: $spacing-medium;
}

/* 通用卡片样式 */
.card {
  background-color: $background-color-light;
  border-radius: $border-radius-medium;
  padding: $spacing-large;
  margin-bottom: $spacing-medium;
  box-shadow: $box-shadow-light;
}

/* 通用按钮样式 */
.btn {
  border-radius: 40rpx;
  font-size: $font-size-medium;
  padding: 20rpx 40rpx;
  text-align: center;
  transition: all $transition-duration $transition-timing-function;
}

.btn-primary {
  background-color: $primary-color;
  color: #FFFFFF;
}

.btn-primary:active {
  background-color: $primary-dark;
}

.btn-outline {
  background-color: transparent;
  color: $primary-color;
  border: 1rpx solid $primary-color;
}

.btn-outline:active {
  background-color: $primary-light;
}

.btn-text {
  background-color: transparent;
  color: $primary-color;
  padding: 10rpx 20rpx;
}

.btn-text:active {
  color: $primary-dark;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* 通用标签样式 */
.tag {
  display: inline-block;
  font-size: $font-size-extra-small;
  padding: 4rpx 12rpx;
  border-radius: 20rpx;
  margin-right: 10rpx;
  margin-bottom: 10rpx;
}

.tag-primary {
  color: $primary-color;
  background-color: $primary-light;
}

.tag-secondary {
  color: $secondary-color;
  background-color: rgba(64, 158, 255, 0.1);
}

.tag-success {
  color: $success-color;
  background-color: rgba(103, 194, 58, 0.1);
}

.tag-warning {
  color: $warning-color;
  background-color: rgba(230, 162, 60, 0.1);
}

.tag-danger {
  color: $danger-color;
  background-color: rgba(245, 108, 108, 0.1);
}

.tag-info {
  color: $info-color;
  background-color: rgba(144, 147, 153, 0.1);
}

/* 通用表单样式 */
.form-item {
  margin-bottom: $spacing-large;
}

.form-label {
  font-size: $font-size-medium;
  color: $text-color-regular;
  margin-bottom: $spacing-small;
  display: block;
}

.form-input {
  width: 100%;
  height: 80rpx;
  background-color: $background-color-dark;
  border-radius: $border-radius-small;
  padding: 0 $spacing-medium;
  font-size: $font-size-medium;
  color: $text-color-primary;
  box-sizing: border-box;
}

.form-textarea {
  width: 100%;
  background-color: $background-color-dark;
  border-radius: $border-radius-small;
  padding: $spacing-medium;
  font-size: $font-size-medium;
  color: $text-color-primary;
  box-sizing: border-box;
  min-height: 200rpx;
}

.form-error {
  font-size: $font-size-small;
  color: $danger-color;
  margin-top: $spacing-extra-small;
}

/* 通用列表样式 */
.list {
  background-color: $background-color-light;
  border-radius: $border-radius-medium;
  overflow: hidden;
}

.list-item {
  padding: $spacing-large;
  border-bottom: 1rpx solid $border-color;
  display: flex;
  align-items: center;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: $font-size-medium;
  color: $text-color-primary;
  margin-bottom: $spacing-extra-small;
}

.list-item-desc {
  font-size: $font-size-small;
  color: $text-color-secondary;
}

.list-item-right {
  margin-left: $spacing-medium;
  color: $text-color-secondary;
}

/* 通用图标样式 */
.icon {
  font-size: 40rpx;
}

.icon-small {
  font-size: 32rpx;
}

.icon-large {
  font-size: 48rpx;
}

/* 通用加载样式 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: $spacing-extra-large 0;
}

.loading-text {
  font-size: $font-size-small;
  color: $text-color-secondary;
  margin-top: $spacing-medium;
}

/* 通用空状态样式 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100rpx 0;
}

.empty-image {
  width: 200rpx;
  height: 200rpx;
  margin-bottom: $spacing-large;
}

.empty-text {
  font-size: $font-size-medium;
  color: $text-color-secondary;
  margin-bottom: $spacing-large;
}

/* 通用分割线 */
.divider {
  height: 1rpx;
  background-color: $border-color;
  margin: $spacing-medium 0;
}

.divider-text {
  position: relative;
  text-align: center;
  margin: $spacing-large 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1rpx;
  background-color: $border-color;
}

.divider-text::before {
  left: 0;
}

.divider-text::after {
  right: 0;
}

.divider-text-content {
  display: inline-block;
  padding: 0 $spacing-medium;
  font-size: $font-size-small;
  color: $text-color-secondary;
  background-color: $background-color;
  position: relative;
  z-index: 1;
}

/* 通用徽章样式 */
.badge {
  position: relative;
}

.badge-content {
  position: absolute;
  top: -10rpx;
  right: -10rpx;
  background-color: $danger-color;
  color: #FFFFFF;
  font-size: $font-size-extra-small;
  min-width: 32rpx;
  height: 32rpx;
  line-height: 32rpx;
  text-align: center;
  border-radius: $border-radius-circle;
  padding: 0 6rpx;
  z-index: 1;
}

/* 通用进度条样式 */
.progress {
  height: 6rpx;
  background-color: $background-color-dark;
  border-radius: $border-radius-circle;
  overflow: hidden;
  margin: $spacing-medium 0;
}

.progress-bar {
  height: 100%;
  background-color: $primary-color;
  border-radius: $border-radius-circle;
  transition: width $transition-duration $transition-timing-function;
}

/* 通用网格布局 */
.grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10rpx;
}

.grid-item {
  padding: 10rpx;
  box-sizing: border-box;
}

.grid-2 {
  width: 50%;
}

.grid-3 {
  width: 33.33%;
}

.grid-4 {
  width: 25%;
}

/* 通用文本样式 */
.text-primary {
  color: $primary-color;
}

.text-secondary {
  color: $secondary-color;
}

.text-success {
  color: $success-color;
}

.text-warning {
  color: $warning-color;
}

.text-danger {
  color: $danger-color;
}

.text-info {
  color: $info-color;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-bold {
  font-weight: bold;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-break {
  word-break: break-all;
  word-wrap: break-word;
}

/* 通用边距 */
.m-0 {
  margin: 0;
}

.m {
  margin: $spacing-medium;
}

.m-t {
  margin-top: $spacing-medium;
}

.m-r {
  margin-right: $spacing-medium;
}

.m-b {
  margin-bottom: $spacing-medium;
}

.m-l {
  margin-left: $spacing-medium;
}

.p-0 {
  padding: 0;
}

.p {
  padding: $spacing-medium;
}

.p-t {
  padding-top: $spacing-medium;
}

.p-r {
  padding-right: $spacing-medium;
}

.p-b {
  padding-bottom: $spacing-medium;
}

.p-l {
  padding-left: $spacing-medium;
}

/* 通用弹性布局 */
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-1 {
  flex: 1;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.align-center {
  align-items: center;
}

.align-stretch {
  align-items: stretch;
}

/* 通用定位 */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

.top-0 {
  top: 0;
}

.right-0 {
  right: 0;
}

.bottom-0 {
  bottom: 0;
}

.left-0 {
  left: 0;
}

/* 通用宽高 */
.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

/* 通用显示 */
.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.none {
  display: none;
}

/* 通用溢出处理 */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.overflow-scroll {
  overflow: scroll;
}

/* 通用z-index */
.z-0 {
  z-index: 0;
}

.z-1 {
  z-index: 1;
}

.z-10 {
  z-index: 10;
}

.z-100 {
  z-index: 100;
}

.z-1000 {
  z-index: 1000;
}

/* 通用动画 */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes slide-left {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-right {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-fade-in {
  animation: fade-in $transition-duration $transition-timing-function;
}

.animate-fade-out {
  animation: fade-out $transition-duration $transition-timing-function;
}

.animate-slide-up {
  animation: slide-up $transition-duration $transition-timing-function;
}

.animate-slide-down {
  animation: slide-down $transition-duration $transition-timing-function;
}

.animate-slide-left {
  animation: slide-left $transition-duration $transition-timing-function;
}

.animate-slide-right {
  animation: slide-right $transition-duration $transition-timing-function;
}

.animate-pulse {
  animation: pulse 1.5s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}
